using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class EnemyState  
{
    protected Enemy enemyBase;
    protected EnemyStateMachine enemyStateMachine;
    private string animatorName;
    protected float stateTimer;
    protected bool triggerCalled = false;
    protected Rigidbody2D rb;
    public  EnemyState(Enemy enemyBase, EnemyStateMachine enemyStateMachine,string animatorName)
    {
        this.enemyBase = enemyBase;
        this.enemyStateMachine = enemyStateMachine;
        this.animatorName = animatorName;
    }
    public virtual void Enter()
    {
        triggerCalled = false;
        rb = enemyBase.rigid;
        enemyBase.animator.SetBool(animatorName, true);
    }
    public virtual void Update()
    {
        stateTimer -= Time.deltaTime;
    }
    public virtual void Exit()
    {
        enemyBase.animator.SetBool(animatorName, false);
        enemyBase.AssignLastAnimatorName(animatorName);
    }
    public virtual void AnimatorFinishTrigger()
    {
        triggerCalled = true;
    }
}